#include "ds.h"
#include "transMessage.h"
int transCommand(int sockfd, train_t *train, cmd_t *cmd)
{
    train->flag = ISCOMMAND;
    train->length = sizeof(cmd_t);
    memcpy(train->data, cmd, sizeof(cmd_t));
    /* printf("%d\n",cmd->cmdType);
    printf("%d  \n", train->length);
    printf("%d\n", train->flag); */
    int ret = send(sockfd, train, sizeof(train_t), 0);
    ERROR_CHECK(ret, -1, "send in transCommand");
    return 0;
}
